import {createRouter,createWebHashHistory} from 'vue-router'

// 引入组件
import Inject from '../views/Inject.vue'
import MyClass from '../views/MyClass.vue'
import My from '../views/My.vue'

// router对象
const router = createRouter({
    // 定义路由类型-- hash路由
    history:createWebHashHistory(),

    // 配置项，配置路径与所需的组件
    routes:[
        {
            path:'/',
            name:'home',
            component: Inject
        },
        {
            path:'/main',
            name:'main',
            component: MyClass
        },
        {
            path:'/login',
            name:'login',
            component: My
        },
    ]
})

// 默认导出router对象
export default router;